<template>
  <div class="newsinfo">
    <!-- header -->
    <van-panel
      class="my-panel"
      :title="newsinfo.zhaiyao"
      :status="'阅读'+newsinfo.click+'次'"
    >
      <div class="content">
        {{newsinfo.content}}
      </div>
    </van-panel>
    <!-- header -->
    <!-- 评论开始 -->
    <Comment :id="id"></Comment>
    <!-- 评论结束 -->
  </div>
</template>
<script>
  import Comment from '@/components/Comment'
export default {
  components:{
    Comment,
  },
  props: ['id'],
  data() {
    return {
      newsinfo: {},
    };
  },
  created() {
    this.getNewsInof();
  },
  methods: {
    async getNewsInof() {
      const res = await this.$http.getNewsInof(this.id);
      this.newsinfo = res.data.message;
    },
  },
};
</script>
<style lang="scss">
  .newsinfo{
    padding: 0 10px;
    .van-cell__title{
      font-size: 16px;
      font-weight: 600;
    }
    .content{
      text-indent: 2em;
      font-size: 12px;
    }
    .my-panel{
      margin-bottom: 10px;
    }
  }
</style>
